/*年轻人，只管向前看，不要管自暴自弃者的话*/
package com.znb.okdown.flutter.android.view

import com.znb.okdown.flutter.Constants
import io.flutter.embedding.engine.plugins.FlutterPlugin


/**
 * create by itz on 2024/1/19 14:13
 * desc :
 **/
class AndroidViewPlugin : FlutterPlugin {
    override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
        //注册的原生组件 Constants.VIEW_TYPE_ID_ANDROID_VIEW 在 flutter 要一致才能调用这个view
        binding.platformViewRegistry.registerViewFactory(
            Constants.VIEW_TYPE_ID_ANDROID_VIEW,
            AndroidViewFactory(binding.binaryMessenger)
        )
    }

    override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {

    }

}